//
//  CollectionDetailViewController.swift
//  NewsAPP
//
//  Created by URNing B on 2021/5/26.
//

import UIKit
import WebKit

class CollectionDetailViewController: UIViewController {

    @IBOutlet var CollectionNewsWebDetail: WKWebView!
    var newsPath : String = ""
    override func viewDidLoad() {
        loadNews(Url: newsPath)
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    func loadNews(Url:String)
    {
        CollectionNewsWebDetail = WKWebView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height))
        let NewsUrl = URL(string: Url)
        let request = URLRequest(url: NewsUrl!)
        CollectionNewsWebDetail.load(request)
        print("显示")
        self.view.addSubview(CollectionNewsWebDetail)
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
